<div class="box"> <!-- Box begins here -->
	<h2>Thêm bài viết</h2>
	<!--
	Standard form within a fieldset tag;
-->
	<?php 
		$error = $this->error;
		$data = $this->data;
	?>
<form method="post" action="" enctype="multipart/form-data"><!-- Form -->
				<?php 
					if(isset($this->success)){
						echo "<div class='success'><center><h3>".$this->success."</h3></center></div>";					
					}
				?>
					<fieldset><legend>Thông tin bài viết</legend>
					<div class="input_field">
						<label for="name">Tiêu đề bài viết</label>
 												
 						<?php echo $this->formText("name",$data['name'],null); ?>
 						<?php 
 							if(isset($error['name'])){
							echo '<span class="validate_error">'.$error['name'].'</span>';
							}
 						?>
					</div>
					<div class="input_field">
						<label for="alias">Alias</label>
 												
 						<?php echo $this->formText("alias",$data['alias'],null); ?>
 						<?php 
 							if(isset($error['alias'])){
							echo '<span class="validate_error">'.$error['alias'].'</span>';
							}
 						?>
					</div>
					<div class="input_field">
							<label for="language">Ngôn ngữ </label>
	 						<select name="language" disabled="disabled">
	 							<?php 
	 								$modelLanguage = new Model_Language_Language();
	 								$language = $modelLanguage->getAll();
	 								foreach ($language as $item)
	 								{	
	 								    if($item['id']=='1')
	 								    {
	 							?>
	 							
	 							<option value="<?php echo $item['id'];?>" selected="selected" ><?php echo $item['name'];?></option>
	 							<?php } else {?>
	 							<option value="<?php echo $item['id'];?>" ><?php echo $item['name'];?></option>
	 							<?php } }?>
	 							
	 						</select>
 					</div>
 					<div class="input_field">
							<label for="category">Thể loại bài viết </label>
	 						<select name="category">
	 							<?php 
	 								$modelArticleCat = new Model_ArticleCat_ArticleCat();
	 								$articlecat = $modelArticleCat->getAllIsActive();
	 								foreach ($articlecat as $item)
	 								{	
	 								    if($item['id']=='1')
	 								    {
	 							?>
	 							
	 							<option value="<?php echo $item['id'];?>" selected="selected" ><?php echo $item['name'].' ('.$modelArticleCat->getNumbSub($item['id']).')';?></option>
	 							<?php } else {?>
	 							<option value="<?php echo $item['id'];?>" ><?php echo $item['name'].' ('.$modelArticleCat->getNumbSub($item['id']).')';?></option>
	 							<?php } }?>
	 							
	 						</select>
 					</div>
 					<div class="input_field">
							<label for="image">Hình ảnh</label>
	 						<?php echo  $this->formFile("image",array("size"=>55));?>
	 						<?php if(!empty($this->error['image'])): ?>
	 						<span class="validate_error"><?php echo $this->error['image']; ?></span>
	 						<?php endif; ?>
					</div>
					</fieldset>
					<fieldset><legend>Thông tin khác</legend>
						<div class="input_field">
							<label for="web_keyword">Tag keyword</label>						
	 						<?php echo $this->formTextarea("web_keyword",$data['web_keyword'],array("cols"=>"5","rows"=>"3")); ?>	 						
						</div>
						<div class="input_field">
							<label for="web_description">Tag description</label>						
	 						<?php echo $this->formTextarea("web_description",$data['web_description'],array("cols"=>"5","rows"=>"8")); ?>	 						
						</div>
						<div class="input_field">
							<label for="status">Trạng thái</label>
 							<?php echo $this->formRadio("status",(empty($data['status'])) ? "1" : $data['status'],null,array("1"=>"Kích hoạt","0"=>"Không kích hoạt"),null); ?>
						</div>
					</fieldset>
					<fieldset><legend>Nội dung</legend>
					<div class="input_field">
							<label for="description">Nội dung mở đầu</label>						
	 						<?php echo $this->formTextarea("description",$data['description'],array("cols"=>"10","rows"=>"10")); ?>	 						
					</div>
					<div>
							<fieldset><legend>Nội dung chính</legend>		
							<?php if(!empty($this->error['summary'])): ?>
	 						<span class="validate_error"><?php echo $this->error['summary']; ?></span>
	 						<?php endif; ?>	 		
	 						<?php echo $this->formTextarea("summary",stripslashes($data['summary']),null); ?>
	 						</fieldset>			
					</div>
					</fieldset>
					<input class="submit" type="submit" value="Lưu" />
			</form><!-- /Form -->
</div> <!-- END Box-->
<script type="text/javascript">
	initEditor("summary");
</script>	